/*
 * @Description: 留言面板
 * @Author: iamsmiling
 * @Date: 2021-05-30 23:33:51
 * @LastEditTime: 2021-06-02 23:00:22
 */

import 'package:credit_business_circle/R/R.dart';
import 'package:flutter/material.dart';

Future showMessageBoardModal(BuildContext context,
    {required Function(String) onMessageTap}) {
  List<String> options = [
    "您好，怎么合作",
    "合作有什么要求吗？",
    "我想了解下具体是什么合作模式",
    "我有你想要的资源，可以聊聊吗？"
  ];
  return showModalBottomSheet(
      context: context,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.only(
          topLeft: Radius.circular(R.dimen.sp10),
          topRight: Radius.circular(R.dimen.sp10),
        ),
      ),
      builder: (BuildContext context) {
        return Container(
          height: R.dimen.height * 237 / 675,
          child: Column(
            children: [
              Container(
                  margin: EdgeInsets.only(
                      left: R.dimen.dp11,
                      right: R.dimen.dp11,
                      top: R.dimen.dp13,
                      bottom: R.dimen.dp14),
                  child: Container(
                    padding: EdgeInsets.all(R.dimen.dp6),
                    decoration: BoxDecoration(
                        border: Border.all(color: R.color.ffcccccc),
                        borderRadius: BorderRadius.circular(R.dimen.sp3)),
                    child: Row(
                      children: [
                        Container(
                          margin: EdgeInsets.only(right: R.dimen.dp9),
                          padding: EdgeInsets.all(R.dimen.dp6),
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(R.dimen.sp3),
                              gradient: LinearGradient(colors: [
                                R.color.ff1bbd8d,
                                R.color.ff14ca94
                              ])),
                          child: Text(
                            "常用语",
                            style: TextStyle(
                                fontSize: R.dimen.sp11,
                                color: R.color.ffffffff),
                          ),
                        ),
                        Expanded(
                          child: TextFormField(
                            decoration: InputDecoration(
                                border: InputBorder.none,
                                enabledBorder: InputBorder.none,
                                focusedBorder: InputBorder.none,
                                hintStyle: TextStyle(
                                    color: R.color.ffaaaaaa,
                                    fontSize: R.dimen.sp12),
                                hintText: "留言内容严禁留联系方式，违规者将做严厉处罚"),
                          ),
                        )
                      ],
                    ),
                  )),
              Divider(height: 1),
              Expanded(
                  child: ListView(
                children: [
                  for (String s in options)
                    GestureDetector(
                      onTap: () => onMessageTap(s),
                      child: Container(
                        margin: EdgeInsets.only(
                            left: R.dimen.dp15, right: R.dimen.dp5),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            GestureDetector(
                              child: Container(
                                padding: EdgeInsets.symmetric(
                                    vertical: R.dimen.dp15),
                                child: Text(
                                  s,
                                  style: TextStyle(
                                      fontSize: R.dimen.sp14,
                                      color: R.color.ff333333),
                                ),
                              ),
                            ),
                            Divider(height: 1)
                          ],
                        ),
                      ),
                    )
                ],
              ))
            ],
          ),
        );
      });
}
